import { NgModule }                         from '@angular/core';
import { RouterModule, Routes }             from '@angular/router';
import { DeviceListComponent }              from './list/list.component';
import { DeviceViewBonusComponent }         from './view/bonus/bonus.component';
import { DeviceViewReplenishmentComponent } from './view/replenishment/replenishment.component';
import { DeviceViewLogComponent }           from './view/log/log.component';
import { DeviceViewInfoComponent }          from './view/info/info.component';
import { DeviceViewComponent }              from "./view/view.component";

const routes: Routes = [
    { path: '', component: DeviceListComponent },
    {
        path    : 'view/:id', component: DeviceViewComponent,
        data    : { title: '设备详情' },
        children: [
            { path: 'bonus/:id', component: DeviceViewBonusComponent },
            { path: 'replenishment/:id', component: DeviceViewReplenishmentComponent },
            { path: 'log/:id', component: DeviceViewLogComponent },
            { path: 'info/:id', component: DeviceViewInfoComponent }
        ]
    },
];

@NgModule({
    imports: [ RouterModule.forChild(routes) ],
    exports: [ RouterModule ]
})
export class DeviceRoutingModule {}
